//保存用户隐私设置
function savePrivacy(v) {

	var hyValue = $('#hyValue option:selected').val();
	var lybValue = $('#lybValue option:selected').val();
	var dtValue = $('#dtValue option:selected').val();
	var jlValue = $('#jlValue option:selected').val();
	var rzValue = $('#rzValue option:selected').val();
	var xcValue = $('#xcValue option:selected').val();
	var fxValue = $('#fxValue option:selected').val();
	
	var chk_jl;
	var chk_rz;
	var chk_img;
	var chk_fx;
	var chk_hy;
	var chk_pl;
	var chk_jjpm;
	var chk_jfxf;
	var chk_yqhy;
	var chk_wcrw;
	var chk_grzl;
	var chk_bt;
	var chk_rtft;
	var chk_rtht;
	
	//	var actionurl = $('form').attr('action');// 提交路径
	//	var checkurl = $('form').attr('check');// 验证路径
//	var formData = new Object();
//	var data = $(":input").each(function() {
//		formData[this.name] = $("#" + this.name).val();
//	});
	
	chk_jl = $('#jl');
	if(chk_jl.attr('checked')){ 
		chk_jl.val(1);
	}else{ 
		chk_jl.val(0);
	}


	chk_rz = $('#rz');
	if(chk_rz.attr('checked')){ 
		chk_rz.val(1);
	}else{ 
		chk_rz.val(0);
	}

	chk_img = $('#img');
	if(chk_img.attr('checked')){ 
		chk_img.val(1);
	}else{ 
		chk_img.val(0);
	}


	chk_fx = $('#fx');
	if(chk_fx.attr('checked')){ 
		chk_fx.val(1);
	}else{ 
		chk_fx.val(0);
	}


	chk_hy = $('#hy');
	if(chk_hy.attr('checked')){ 
		chk_hy.val(1);
	}else{ 
		chk_hy.val(0);
	}

	chk_pl = $('#pl');
	if(chk_pl.attr('checked')){ 
		chk_pl.val(1);
	}else{ 
		chk_pl.val(0);
	}

	chk_jjpm = $('#jjpm');
	if(chk_jjpm.attr('checked')){ 
		chk_jjpm.val(1);
	}else{ 
		chk_jjpm.val(0);
	}

	chk_jfxf = $('#jfxf');
	if(chk_jfxf.attr('checked')){ 
		chk_jfxf.val(1);
	}else{ 
		chk_jfxf.val(0);
	}


	chk_yqhy = $('#yqhy');
	if(chk_yqhy.attr('checked')){ 
		chk_yqhy.val(1);
	}else{ 
		chk_yqhy.val(0);
	}	

	chk_wcrw = $('#wcrw');
	if(chk_wcrw.attr('checked')){ 
		chk_wcrw.val(1);
	}else{ 
		chk_wcrw.val(0);
	}	
		

	chk_grzl = $('#grzl');
	if(chk_grzl.attr('checked')){ 
		chk_grzl.val(1);
	}else{ 
		chk_grzl.val(0);
	}	

	chk_bt = $('#bt');
	if(chk_bt.attr('checked')){ 
		chk_bt.val(1);
	}else{ 
		chk_bt.val(0);
	}	
	
	chk_rtft = $('#rtft');
	if(chk_rtft.attr('checked')){ 
		chk_rtft.val(1);
	}else{ 
		chk_rtft.val(0);
	}		

	chk_rtht = $('#rtht');
	if(chk_rtht.attr('checked')){ 
		chk_rtht.val(1);
	}else{ 
		chk_rtht.val(0);
	}	
	
	var url = "userInfoController.do?saveUserPrivacys&options=" + v;
	$.ajax({
		async : false,
		cache : false,
		type : 'POST',
		url : url,
//		data : formData,
		data:{
			hyValue:hyValue,
			lybValue:lybValue,
			dtValue:dtValue,
			jlValue:jlValue,
			rzValue:rzValue,
			xcValue:xcValue, 
			fxValue:fxValue,
			
			jl:chk_jl.val(),
			rz:chk_rz.val(),
			img:chk_img.val(),
			fx:chk_fx.val(),
			hy:chk_hy.val(),
			pl:chk_pl.val(),
			jjpm:chk_jjpm.val(),
			jfxf:chk_jfxf.val(),
			yqhy:chk_yqhy.val(),
			wcrw:chk_wcrw.val(),
			grzl:chk_grzl.val(),
			bt:chk_bt.val(),
			rtft:chk_rtft.val(),
			rtht:chk_rtht.val()
			
		},
		success : function(data) {
			var d = $.parseJSON(data);
			if (d.success) {
				alert(d.msg);
				// var url= "/indexController.do?index";
				// location.href = url;
				//				setTimeout("window.location.href='" + actionurl + "'", 1000);
			} else {
				alert(d.msg);
			}
		},

		error : function() {// 请求失败处理函数
			alert("设置失败!");
		}

	});
}


//设置动态筛选
function saveFiltrate() {
	var chk_qt = $('#qt');
	if(chk_qt.attr('checked')){ 
		chk_qt.val(1);
	}	
	
	var chk_bzrs = $('#bzrs');
	if(chk_bzrs.attr('checked')){ 
		chk_bzrs.val(1);
	}
	
	var chk_hdrs = $('#hdrs');
	if(chk_hdrs.attr('checked')){ 
		chk_hdrs.val(1);
	}	
		
	var chk_pyrs = $('#pyrs');
	if(chk_pyrs.attr('checked')){ 
		chk_pyrs.val(1);
	}	
	var chk_qr = $('#qr');
	if(chk_qr.attr('checked')){ 
		chk_qr.val(1);
	}
	var chk_ts = $('#ts');
	if(chk_ts.attr('checked')){ 
		chk_ts.val(1);
	}	
	var chk_tx = $('#tx');
	if(chk_tx.attr('checked')){ 
		chk_tx.val(1);
	}	
	var chk_brs = $('#brs');
	if(chk_brs.attr('checked')){ 
		chk_brs.val(1);
	}	
	
	var url = "userInfoController.do?saveUserPrivacys&options=Filtrate";
	$.ajax({
		async : false,
		cache : false,
		type : 'POST',
		url : url,
		data :{
			qt:chk_qt.val(),
			bz:chk_bzrs.val(),
			hd:chk_hdrs.val(),
			py:chk_pyrs.val(),
			qr:chk_qr.val(),
			ts:chk_ts.val(),
			tx:chk_tx.val(),
			brs:chk_brs.val()
		},
	success : function(data) {
		var d = $.parseJSON(data);
		if (d.success) {
			alert(d.msg);
		} else {
			alert(d.msg);
		}
	},
	error : function() {// 请求失败处理函数
		alert("设置失败!");
	}

});
}






